package com.tuozq.controller;

import com.antong.cloud.common.core.util.R;
import com.tuozq.pojo.Product;
import com.tuozq.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    ProductService productService;

    @GetMapping("/selectProduct")
    public R<List<Product>> selectProduct(){
        return R.ok(productService.selectProduct());
    }

    @GetMapping("/selectProductById")
    public R<Product> selectProductById(String productId){
        return R.ok(productService.selectProductById(productId));
    }

}
